<div id="formStatus">{$error.display}</div>
<h1>{t 1=$originalDocument->getLabel()}"%s" page translation{/t}</h1>

<div id="moduleTabs">
     <ul>
         <li><a class="selected" href=""><span>{t}Properties{/t}</span></a></li>
     </ul>
</div>

<form name="form" method="post" action="?module=website&action=block_TranslatePage&docId={$originalDocument->getUniqueId()}&docLang={$destLang}" >
	<div class="submitButton"><button type="reset" class="greyButton" >{t}Cancel{/t}</button> <button type="submit" name="form[submit]" class="greenButton" >{t}Save{/t}</button></div>
	<table class="listTable">
		<tr><th style="width: 250px;">{t}Fields{/t}</th><th>{t}Values{/t}</th></tr>
		<tr>
			<td>{t}Traduction type{/t}</td>
			<td>
				<select name="form[transType]" id="transType">
					<option value="0">---</option>
					<option value="1">{t}Create a new page{/t}</option>
					<option value="2">{t}Create a new page on the same model{/t}</option>
					<option value="3">{t}Duplicate the structure{/t}</option>
					<option value="4">{t}Duplicate the structure and the orginal content{/t}</option>
				</select>
                <span style="display: none" class="transTemplates">			
                    {t}Template{/t}
                    <select name="form[transTemplates]">
                    {foreach from=$templates item=template}
                        <option value="{$template.fileName}">{$template.label}</option>
                    {/foreach}
                    </select>
                </span>
			</td>
		</tr>
    <tr><td>{t}Key{/t}</td><td>{$originalDocument->getUniqueId()}</td></tr>
	<tr><td>{t}Original language{/t}</td><td>{$originalDocument->getLang()}</td></tr>
	<tr><td>{t}Destination language{/t}</td><td>{$destLang}</td></tr>
	<tr><td>{t}Original URL{/t}</td><td>{if $originalDocument->getPublicationstatus() == "PUBLISHED"}<a href="{$originalDocument->getCompleteUrl()}" target="_blank">{/if}{$originalDocument->getCompleteUrl()}{if $originalDocument->getPublicationstatus() == "PUBLISHED"}</a>{/if}</td></tr>
	</table>
</form>

{literal}
<script type="text/javascript">
    $(document).ready(function()
    {
        $("#transType").change(function(){
            activeTemplates($(this).val());
        });

        $('button[type=reset]').click(function(){
             activeTemplates(0);
        });
    });

    function activeTemplates(template)
    {
        if(template != 1)
        {
            $(".transTemplates").hide();
        }
        else
        {
            $(".transTemplates").show();
        }
    }
</script>
{/literal}